package top.codef.config.servicemonitor;
//package com.kuding.config.servicemonitor;
//
//import org.apache.commons.logging.Log;
//import org.apache.commons.logging.LogFactory;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.boot.autoconfigure.AutoConfigureAfter;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
//import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
//import org.springframework.boot.autoconfigure.mail.MailProperties;
//import org.springframework.boot.autoconfigure.mail.MailSenderAutoConfiguration;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.mail.MailSender;
//
//import com.kuding.config.annos.ConditionalOnServiceMonitor;
//import com.kuding.notice.EmailNoticeSendComponent;
//import com.kuding.notice.INoticeSendComponent;
//import com.kuding.pojos.servicemonitor.ServiceCheckNotice;
//import com.kuding.properties.notice.EmailNoticeProperty;
//import com.kuding.text.ServiceMonitorResolver;
//
//@Configuration
//@AutoConfigureAfter({ MailSenderAutoConfiguration.class })
//@ConditionalOnBean({ MailSender.class, MailProperties.class })
//@ConditionalOnServiceMonitor
//@ConditionalOnProperty(value = "prometheus.email.enabled", havingValue = "true")
//public class ExceptionNoticeEmailSendingConfig {
//
//	@Autowired
//	private MailSender mailSender;
//	@Autowired
//	private MailProperties mailProperties;
//	@Autowired
//	private EmailNoticeProperty emailExceptionNoticeProperty;
//
//	private final static Log logger = LogFactory.getLog(ExceptionNoticeEmailSendingConfig.class);
//
//	@Bean
//	@ConditionalOnMissingBean(parameterizedContainer = INoticeSendComponent.class)
//	public INoticeSendComponent<ServiceCheckNotice> emailNoticeSendComponent(
//			ServiceMonitorResolver exceptionNoticeResolver) {
//		logger.debug("创建邮件异常通知");
//		INoticeSendComponent<ServiceCheckNotice> component = new EmailNoticeSendComponent<ServiceCheckNotice>(
//				mailSender, mailProperties, emailExceptionNoticeProperty, exceptionNoticeResolver);
//		return component;
//	}
//
//	@Bean
//	@ConditionalOnMissingBean
//	public ServiceMonitorResolver serviceMonitorResolver() {
//		return x -> x.generateText();
//	}
//}
